package hfjava;

public class Demo {
    //属性
    private  String name;
    private String jobName;
    private String duty;
    private int age;
    private String object;

    //方法
    public Demo( String name,String jobName,String duty, int age){
            setAge(age);
            setDuty(duty);
            setJobName(jobName);
            setName(name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getDuty() {
        return duty;
    }

    public void setDuty(String duty) {
        this.duty = duty;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age>=15){
            this.age=age;
        }else{
            this.age=15;
            System.out.println("年龄不对");
        }
    }
    public String getObject(){
        return "IT";
    }
    public void showInfo(){
        System.out.println(jobName+"的"+duty+name+"年龄为："+age+"\t从业方向："+getObject());
    }


    //test
    public static void main(String[] args) {
        Demo one=new Demo("大牛","北大青鸟","boss",11);
        one.showInfo();
    }
}
